package com.demo.controller;

import com.demo.entity.BOTest;
import com.demo.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/test")
public class TestController {

    @Autowired
    private TestService testService;

    @GetMapping("/save")
    public String add(){
        testService.save();
        return "success";
    }

    @GetMapping("/find")
    public List<BOTest> find(){
        return testService.find();
    }

}
